package main

import (
	"fmt"
)

func main8() {

	sum := 0.0
	var avg float64
	xs := [6]float64{1, 2, 3, 4, 5, 6}
	switch len(xs) {
	case 0:
		avg = 0
	default:
		//下划线表示那个值舍去，即舍去下标索引
		for _, v := range xs {
			sum += v
		}
		avg = sum / float64(len(xs))
	}
	fmt.Println(avg)
}
